<?php if(count($this->errors) > 0){
     
    ?>

<div class="alert alert-danger alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                <?php 
                    foreach ($this->errors as $errorName => $error){
                        foreach ($error as $message){
                                        echo "<strong>$errorName : </strong>$message <br />";
                        }
                    }
                                        ?>
</div>
<?php } ?>
<div class="panel panel-primary">
    <div class="panel-heading">
    <h3 class="panel-title"><?php echo $this->viewName?></h3>
  </div>
<div class="panel-body">
    <form action="<?php echo $this->baseUrl().$this->post?>" method="post" enctype="multipart/form-data">
    <?php echo $this->form->id ?>
    <div class="form-group">
      <label for="firstName">First Name</label>
      <?php echo $this->form->firstName ?>
    </div>
    <div class="form-group">
      <label for="lastName">Last Name</label>
      <?php echo $this->form->lastName ?>
    </div>
    <div class="form-group">
      <label for="email">Email</label>
      <?php echo $this->form->email ?>
    </div>
    <div class="form-group">
      <label for="password">Password</label>
      <?php echo $this->form->password ?>
    </div>
    <div class="form-group">
      <label for="passwordRetype">Retype Password</label>
      <?php echo $this->form->passwordRetype ?>
    </div>

    <div class="panel-group" id="accordion">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h4 class="panel-title">
        <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
          Additional Information
        </a>
      </h4>
    </div>
    <div id="collapseOne" class="panel-collapse collapse in">
      <div class="panel-body">
    <div class="checkbox">
        <label class="">Gender</label><br />
      <?php echo $this->form->gender ?>
    </div>
    <div class="form-group">
      <label for="jobTitle">Job Title</label>
      <?php echo $this->form->jobTitle ?>
    </div>
    <div class="form-group">
      <label for="description">About You</label>
      <?php echo $this->form->description ?>
    </div>
          
    <div class="form-group">
      <label for="image">Personal Image</label>
      <?php echo $this->form->image ?>
    </div>
          <?php if($this->image){ ?>
          <div class="bs-callout bs-callout-info pull-left">
            <h4>Don't forget to upload your photo!</h4>
            <p>You can change it by uploading your photo from above element, Or remove it and return to the default image</p>
          </div>
          
          <div class="pull-right text-center">
              <img width="200px" height="200px" src="<?= $this->baseUrl()."/upload/profile/".$this->image?>" class="img-thumbnail" />
              <figcaption  >Current Photo</figcaption>
              <label class="checkbox-inline">
                  <?= $this->form->removeImage?> (<em>remove</em> image)
              </label>
          </div>
          <div class="clearfix"></div>
          <?php } else {
              ?>
              <div class="bs-callout bs-callout-info pull-left">
                 <h4>Don't forget to upload your photo!</h4>
                <p>There is a default image, you can change it by uploading your photo from above element.</p>
              </div>
              <div class="pull-right">
              <img width="200px" height="200px" src="<?= $this->baseUrl()."/images/default_image.png" ?>" class="img-thumbnail" />
              <figcaption class="text-center" >Current Photo</figcaption>
              
          </div>
          <div class="clearfix"></div>
          <?php
          }
?>
    
    <div class="form-group">
      <label for="facebook">Facebook Account</label>
      <?php echo $this->form->facebook ?>
    </div>
    
    <div class="form-group">
      <label for="twitter">Twitter Account</label>
      <?php echo $this->form->twitter ?>
    </div>
    
    <div class="form-group">
      <label for="linkedin">LinkedIn Account</label>
      <?php echo $this->form->linkedin ?>
    </div>
    <div class="form-group">
      <label for="google">Google+ Account</label>
      <?php echo $this->form->google ?>
    </div>
      </div>
    </div>
  </div>
    
     
    <?php echo $this->form->submit ?>
</form>
    </div>
</div>
</div>
</div>